package com.leetcode.LC;

import java.util.Arrays;

public class LC389 {
    public char findTheDifference(String s, String t) {

        int[] ints = new int[26];
        Arrays.fill(ints,0);
        for (int i = 0; i <=s.length(); i++) {
            if (i<s.length()){
                ints[s.charAt(i)-'a']+=1;
            }
            ints[t.charAt(i)-'a']-=1;
        }
        for (int i = 0; i < 26; i++) {
            if (ints[i]!=0){
                return (char)('a'+i);
            }
        }
        return ' ';
    }

    public static void main(String[] args) {
        System.out.println(new LC389().findTheDifference("abcd", "abcde"));
    }
}
